<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
  <meta name="keywords" content="">
  <meta name="description" content="">
  <meta name="author" content="">
  <title>集团电商</title>
  <!--common-->
  <link href="__CSS__/bootstrap.min.css" rel="stylesheet">
  <script src="__JS__/jquery-2.2.3.min.js"></script>
</head>
<body class="sticky-header">
        <div class="container" style="padding-top: 10px;">
           <div class="main-title">
            <h2>用户组授权</h2>
            </div>

        <div id="auth_groups">
            <form class="form-horizontal" action="{:url('addToGroup')}" method="post">
                <div class="form-group" ><span class="lable label-danger">{$nickname}</span> 所属的用户组列表</div>
                <div class="form-group">
                {volist name="auth_groups" id="vo"}
                    <label class="checkbox-inline">
                        <input class="auth_groups" type="checkbox" name="group_id[]" value="{$vo.id}">{$vo.title}
                    </label>
                {/volist}
                </div>
                <input type="hidden" name="uid" value="{:input('id')}">
                <input type="hidden" name="batch" value="true">
                <div style="margin-top: 10px;" class="form-group">
                    <button type="submit" class="btn btn-success">确 定</button>
                </div>
            </form>
        </div>
        <!--body wrapper end-->
    </div>
    <script type="text/javascript">
    $(function(){
        var group = [{$user_groups}];
        $('.auth_groups').each(function(){
            if( $.inArray( parseInt(this.value,10),group )>-1 ){
                $(this).prop('checked',true);
            }
        });
    });
</script>
</body>
</html>


